home *** CD-ROM | disk | FTP | other *** search
/ Enter 2005 January / EnterCD 0105.iso / Internet / Norton Internet Security 2005 / NIS_Retail.EXE / Setup / SymLT / ActRes.DLL / HTML / ACTIVATIONPANEL.JS < prev    next >
Encoding:
Text File  |  2004-08-17  |  4.6 KB  |  158 lines

  1. var MainFrame = window.parent;
  2. var TimerID = 0;
  3. var SelectFrame = null;
  4. // Globals
  5. MainFrame.iLicType;
  6. MainFrame.iLicZone;
  7.  
  8. var bReady = false;
  9. var g_lTimerID = 0;
  10.  
  11. //Enums for button states
  12. var NEXT_BUTTON    = 0;
  13. var BACK_BUTTON    = 1;
  14. var SKIP_BUTTON    = 2;
  15.     
  16. var BUTTON_KILLED    = -1;
  17. var BUTTON_DISABLE    = 0;
  18. var BUTTON_ENABLE    = 1;
  19. var BUTTON_HIDE        = 2;
  20. var BUTTON_SHOW        = 4;
  21. var BUTTON_SETFOCUS = 8;
  22.  
  23.  
  24. // DJSMar license Types
  25. var DJSMAR_LicenseType_Violated            = -1;
  26. var DJSMAR_LicenseType_Retail            = 0;
  27. var DJSMAR_LicenseType_Trial            = 1;
  28. var DJSMAR_LicenseType_Rental            = 2;
  29. var DJSMAR_LicenseType_TryDie            = 3;
  30. var DJSMAR_LicenseType_Beta                = 4;
  31. var DJSMAR_LicenseType_Unlicensed        = 5;
  32. var DJSMAR_LicenseType_ESD                = 6;
  33.  
  34. // DJSMar license Zones
  35. var DJSMAR_LicenseZone_Trial            =   (0x00000001); // in a trial period
  36. var DJSMAR_LicenseZone_Expired            =   (0x00000002); // the license has expired
  37. var DJSMAR_LicenseZone_Warning            =   (0x00000004); // the license is about to expire
  38. var DJSMAR_LicenseZone_PreActivation    =   (0x00000008); // the license has never been activated
  39. var DJSMAR_LicenseZone_PostActivation    =    (0x00000010); // the license has been activated
  40. var DJSMAR_LicenseZone_Purchased        =   (0x00000020); // the license is in a purchased(AKA Activated) state
  41. var DJSMAR_LicenseZone_Violated            =   (0x00000040); // the license has been violated (i.e. failed security checks)
  42. var DJSMAR_LicenseZone_Killed            =   (0x00000080); 
  43.  
  44. function LoadStockPanel()
  45. {
  46.     window.parent.frames("main").navigate( "StockPanel.htm" );
  47. }
  48.  
  49. function OnLoad()
  50. {
  51.     if ( MainFrame.g_bRoadmapFrameLoaded && MainFrame.g_bSelectFrameLoaded )
  52.     {
  53.         UpdatePage();
  54.     }
  55.     else
  56.     {
  57.         // Wait for the other frames to load
  58.         g_lTimerID = window.setInterval( "UpdatePage()", 500 );
  59.     }
  60. }
  61.  
  62. function UpdatePage()
  63. {
  64.     if ( MainFrame.g_bRoadmapFrameLoaded && MainFrame.g_bSelectFrameLoaded )
  65.     {
  66.         
  67.         try
  68.         {
  69.             SelectFrame = window.parent.frames("bottom");
  70.             clearInterval(g_lTimerID);    
  71.             
  72.             // See what license zone and type we are and if we don't need to 
  73.             // go on to activation we can cut them off here by navigating to the 
  74.             // stockpanel
  75.             
  76.             MainFrame.iLicType = window.external.ObjectArg("DRM::LicenseType");
  77.             MainFrame.iLicZone = window.external.ObjectArg("DRM::LicenseZone");
  78.             
  79.             if( (MainFrame.iLicZone & DJSMAR_LicenseZone_Violated) == DJSMAR_LicenseZone_Violated )
  80.             {
  81.                 LoadStockPanel();
  82.                 return;
  83.             }
  84.             
  85.             switch ( MainFrame.iLicType )
  86.             {
  87.                 case DJSMAR_LicenseType_TryDie:
  88.                     
  89.                     // Show stock panels for trial and killed states
  90.                     LoadStockPanel();
  91.                     return;
  92.                     
  93.                 break;
  94.                 
  95.                 case DJSMAR_LicenseType_Beta:
  96.                     // Show stock panels for double expired
  97.                     if ( ((MainFrame.iLicZone & DJSMAR_LicenseZone_PostActivation) == DJSMAR_LicenseZone_PostActivation) &&
  98.                         ((MainFrame.iLicZone & DJSMAR_LicenseZone_Expired) == DJSMAR_LicenseZone_Expired))
  99.                     {
  100.                         LoadStockPanel();
  101.                         return;
  102.                     }
  103.                 break;
  104.                 
  105.                 default:
  106.                 break;
  107.             }
  108.             
  109.             // Disable the buttons for beginning state
  110.             SelectFrame.DisableButtons();
  111.             
  112.             // Show the skip button
  113.             SelectFrame.SkipButton.disabled = true;
  114.             SelectFrame.SkipButton.style.display = "";
  115.             SelectFrame.SkipButton.innerHTML = ActBtnSkipText.innerHTML;
  116.             SelectFrame.SkipButton.accessKey = ActBtnSkipHotKey.innerText
  117.             
  118.             SelectFrame.bControlDone = false;
  119.             
  120.             // Get a pointer to our Activation object
  121.             MainFrame.g_PageOb = SymUIAx;
  122.             
  123.             // Set background to white        
  124.             SymUIAx.SetProperty("Color0", "FFFFFF");
  125.             SymUIAx.SetProperty("Color1", "FFFFFF");
  126.             SymUIAx.SetProperty("Color2", "FFFFFF");
  127.             SymUIAx.SetProperty("Color3", "FFFFFF");
  128.             
  129.             // Set us to first in chain if we are the first panel.
  130.             if( MainFrame.m_nCurrentPanel  == 0 )
  131.                 SymUIAx.SetProperty( "FirstInChain", "true" );
  132.             else
  133.                 SymUIAx.SetProperty( "FirstInChain", "false" );
  134.  
  135.             // Actwizard is always last in chain at least til they want to add ore apges to it            
  136.             SymUIAx.SetProperty( "LastInChain", "true" );
  137.             
  138.             // No LR in Actwizard
  139.             SymUIAx.SetProperty( "SendLiveRegistration", "false");
  140.             
  141.             // Get the path to the helper DLL from the collection and tell the control
  142.             SymUIAx.SetProperty( "HelperDLLPath", window.external.ObjectArg("DRM::ActivationUIPath"));
  143.  
  144.             SymUIAx.SetDataCollection( window.external.ObjectArg );
  145.             
  146.             SymUIAx.Initialize();
  147.         }
  148.         catch(err)
  149.         {
  150.             MainFrame.iLicType = DJSMAR_LicenseType_Violated;
  151.             MainFrame.iLicZone = DJSMAR_LicenseZone_Violated;
  152.             
  153.             LoadStockPanel();
  154.         }
  155.     }
  156. }
  157.  
  158.